const router = require('koa-router')()
const api=require("./mock")
router.get('/', async (ctx, next) => {
  await ctx.render('index', {
    title: 'Hello Koa 2!'
  })
})

router.get('/string', async (ctx, next) => {
  ctx.body = 'koa2 string'
})

router.get('/api/mock/data', async (ctx, next) => {
   let data=api.mockData();
   console.log(data)
  ctx.body = {
   code:0,
   msg:"测试数据",
   data:data
  }
})

module.exports = router
